<?php 
$webroot="../";
if(session::is_manager()==TRUE)
{
	
	require_once '../html/admintemplate.php';
}
else 
{
	require_once '../html/template.php';
}
?>
<script type="text/javascript" src="../html/jquery.js"></script>
<script type="text/javascript">
function addpaypal(ppid,price,country)
{
	$("#freshcvvupdatecart").html("<img src='../images/loading.gif' />");
	$.ajax({
		url:"updatepaypal.php",
		type:'get',
		data:"ppid="+ppid+"&price="+price+"&country="+country,
		cache: false,
		success: function(j){
		$("#freshcvvupdatecart").html(j);
	  	}
	});	
 	
}
function removeppid(id)
{
	$.ajax({
		url:"removecart.php",
		type:'get',
		data:"ppid="+id,
		cache: false,
		success: function(j){
			$.ajax({
				  url: "updatepaypal.php",
				  cache: false,
				  success: function(html){
				    $("#freshcvvupdatecart").html(html);
				  }
				});
	  	}
	});	
	
}
function getPaypalCountry()
{
	$("#paypalCountryResult").html("<img scr='../images/loadingmini.gif' />");
	$.ajax({
		url:"findPaypalCountry.php",
		type:'get',
		data:"agent="+$("#paypalAgent").val(),
		cache: false,
		success: function(j){
			$("#paypalCountryResult").html(j);
		}
	});	
}
function searchPaypal()
{
	$("#paypalResult").html("<img scr='../images/loading.gif' />");
	$.ajax({
		url:"buyPaypal.php",
		type:'get',
		data:"agent="+$("#paypalAgent").val()+"&country="+$("#paypalCountry").val()+"&paypalType="+$("#paypalType").val()+"&is_verify="+$("#is_verify").val()+"&have_mailpass="+$("#have_mailpass").val(),
		cache: false,
		success: function(j){
			$("#paypalResult").html(j);
		}
	});	
}
function emptycart()
{
	$.ajax({
		url:"removecart.php",
		type:'get',
		data:"empty=1",
		cache: false,
		success: function(j){
			$("#freshcvvupdatecart").html("Your Cart is now Empty");
	  	}
	});	
	
}
</script>

<?php
?>

<table>
<tr class="classarlert">
<td>
Agent<select id="paypalAgent" name="paypalAgent" onchange="javascript:getPaypalCountry();" >
<?php echo $findAgent;?>
</select>
</td>
<td id="paypalCountryResult">
Country<select name="paypalCountry" id="paypalCountry" onclick="javascript:alert('Choose agent' );" >
<option value="" >All</option>
</select>
</td>
<td>
Paypal Type<select name="paypalType" id="paypalType" >
<option value="">All</option>
<option value="personal">Personal</option>
<option value="premier">Premier</option>
<option value="business">Business</option>
</select>
</td>
<td>
Is Verified
<select name="is_verify" id="is_verify" >
<option value="no">No</option>
<option value="yes">YES</option>
</select>
</td>
<td>
Have Mail Pass
<select name="have_mailpass" id="have_mailpass" >
<option value="no">No</option>
<option value="yes">YES</option>
</select>
</td>
<td>
<input name="Search" type="button" onclick="javascript:searchPaypal();" value="Search Paypal" />
</td>
</tr>
</table>
<table id="paypalResult" width="100%">

</table>